package views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;

public class TeremnyilvantartasFoglalasView extends Composite {

	private TeremnyilvantartasNezetView nezetView;
	private TeremnyilvantartasEsemenyNaploView esemenyNaploView;
	private ScrolledComposite scrolledComposite;

	public TeremnyilvantartasFoglalasView(Composite parent, int style) {
		super(parent, style);
		setLayout(new GridLayout(1, false));

		SashForm sashForm = new SashForm(parent, SWT.BORDER | SWT.VERTICAL);
		sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

		scrolledComposite = new ScrolledComposite(sashForm, SWT.NONE
				| SWT.H_SCROLL | SWT.V_SCROLL);
		scrolledComposite.setAlwaysShowScrollBars(true);
		scrolledComposite.setExpandHorizontal(true);
		scrolledComposite.setExpandVertical(true);

		nezetView = new TeremnyilvantartasNezetView(scrolledComposite, SWT.NONE);
		scrolledComposite.setContent(nezetView);
		scrolledComposite.setMinSize(nezetView.computeSize(SWT.DEFAULT,
				SWT.DEFAULT));

		esemenyNaploView = new TeremnyilvantartasEsemenyNaploView(sashForm,
				SWT.NONE);

		sashForm.setWeights(new int[] { 5, 1 });
	}

	public TeremnyilvantartasEsemenyNaploView getEsemenyNaploView() {
		return esemenyNaploView;
	}

	public TeremnyilvantartasNezetView getNezetView() {
		return nezetView;
	}

	public ScrolledComposite getScrolledComposite() {
		return scrolledComposite;
	}

}
